def getprimes(limit):
	primes = set()
	nums = range(2,limit+1)
	marked = [0] * limit
	p = 2
	for p in nums:
		if not marked[p-2]:
			n = 2
			a = p*n
			while(a <= limit):
				marked[a-2] = 1
				n = n + 1
				a = p*n
	for x in range(limit-1):
		if not marked[x]:
			primes.add(nums[x])
	return primes